<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>PlazesService</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    <link rel="stylesheet" type="text/css" href="css/VisDoc.css"/>
    <script src="js/doc.js" type="text/javascript">//</script>
  </head>
  <body pageId="Pagecom_orthogeneric_webapis_plazes_PlazesService">
    <div class="VisDoc"><span id="PageTop"><!----></span>
      <div class="content"><span class="accessKeysInfo"><span class="label"><a href="#" class="accessKeyInfoToggle" onclick="toggleAccessKeyInfo(); return true;">Access keys</a></span><span class="accessKeyLinks" style="display:none;"><a href="#PageTop" accesskey="t">T</a>op, <a href="#Summary" accesskey="s">S</a>ummary, <a href="#Constructor" accesskey="c">C</a>onstructors, 
C<a href="#Classproperties" accesskey="l">l</a>ass properties, 
Instance <a href="#Instanceproperties" accesskey="p">p</a>roperties, 
Instance <a href="#Instancemethods" accesskey="m">m</a>ethods, <a href="#Eventhandlers" accesskey="e">E</a>vent handlers</span></span><h1>PlazesService</h1>
        <div class="classProperties">
          <table cellspacing="0">
            <tr>
              <th>Kind of class:</th>
              <td>class</td>
            </tr>
            <tr>
              <th>Inherits from:</th>
              <td>none</td>
            </tr>
            <tr>
              <th class="classDetails">Version:</th>
              <td class="classDetails">1.0a</td>
            </tr>
            <tr>
              <th class="classDetails">Author:</th>
              <td class="classDetails">florian.mlodzik@gmail.com</td>
            </tr>
            <tr>
              <th class="classDetails">Classpath:</th>
              <td class="classDetails">com.orthogeneric.webapis.plazes.PlazesService</td>
            </tr>
            <tr>
              <th class="classDetails">File last modified:</th>
              <td class="classDetails">Saturday, 29 July 2006, 01:16:35</td>
            </tr>
          </table>
        </div>
        <div class="classDescription">
          <div class="descriptionSummary">The PlazesService represents an Actionscript2 abstraction of the <a href="http://beta.plazes.com/api/plazes/">PlazesApi</a>.</div><br /> Methods provided by the API are organized like object methods ("object.method") which are hereby defined as "groups".<br /> API-groups are up to this version (PlazesApi 1.0) "plaze", "user" and "api" which can all be accessed from a PlazesService-instance with their corresponding methods through the member variables <a href="com_orthogeneric_webapis_plazes_PlazesService.html#plaze">plaze</a>, <a href="com_orthogeneric_webapis_plazes_PlazesService.html#user">user</a> and <a href="com_orthogeneric_webapis_plazes_PlazesService.html#api">api</a>.<br /> Calling a group's method will automagically invoke a remote procedure call, receive the result, serialize it to Actionscript datatypes and make it available through a dispatched <a href="com_orthogeneric_webapis_plazes_events_PlazesResult.html">PlazesResult</a>'s <code>result</code> property. A <a href="com_orthogeneric_webapis_plazes_events_PlazesFault.html">PlazesFault</a> and a <a href="com_orthogeneric_webapis_plazes_events_PlazesError.html">PlazesError</a> will be  dispatched upon receival of according RPC-responses.<br /><br /> <b>Compatibility:</b> <br /> Compiles with Adobe Flash MX 2004 IDE, Adobe Flash 8 IDE and <a href="http://www.mtasc.org/">MotionTwin</a> 1.12<br /> Adobe FlashPlayer 6.0.79 to 8.0.22<div class="classFields">
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">Usage:</span><div class="item">Example 1 (override event handlers):<pre><span class="codeKeyword">var</span> ps:PlazesService = <span class="codeKeyword">new</span> PlazesService(<span class="codeString">"myDevKey"</span>, <span class="codeString">"myUN"</span>, <span class="codeString">"myPW"</span>);
    ps.onPlazesResult = <span class="codeKeyword">function</span> (evt:PlazesResult)
    {
      <span class="codeIdentifier">trace</span>(<span class="codeString">"Result received from remote method: "</span>+evt.remoteMethod);
      <span class="codeKeyword">if</span> (evt.localMethod == <span class="codeString">"getVersion"</span>) {
        <span class="codeIdentifier">trace</span>(<span class="codeString">"PlazesApi version is "</span>+evt.result);
      }
    }
    ps.onPlazesFault = <span class="codeKeyword">function</span> (evt:PlazesFault)
    {
      <span class="codeIdentifier">trace</span>(<span class="codeString">"Fault received from remote method: "</span>+evt.remoteMethod);
    }
    ps.onPlazesError = <span class="codeKeyword">function</span> (evt:PlazesError)
    {
      <span class="codeIdentifier">trace</span>(<span class="codeString">"Error occurred while trying to call remote method: "</span>+evt.remoteMethod);
    }
    ps.user.getTrazes(<span class="codeNumber">90</span>);
    ps.api.<span class="codeIdentifier">getVersion</span>();</pre>        <br />       Example 2 (add listener to event/queue remote calls):<pre><span class="codeKeyword">var</span> resultListener:<span class="codeIdentifier">Object</span> = <span class="codeKeyword">new</span> <span class="codeIdentifier">Object</span>();
    resultListener.onPlazesResult = <span class="codeKeyword">function</span> (evt:PlazesResult)
    {
      <span class="codeIdentifier">trace</span>(<span class="codeString">"Result received from remote method: "</span>+evt.remoteMethod);
      <span class="codeKeyword">if</span> (evt.localMethod == <span class="codeString">"getVersion"</span>) {
        <span class="codeIdentifier">trace</span>(<span class="codeString">"PlazesApi version is "</span>+evt.result);
      }
    }
<span class="codeKeyword">var</span> ps:PlazesService = <span class="codeKeyword">new</span> PlazesService(<span class="codeString">"myDevKey"</span>, <span class="codeString">"myUN"</span>, <span class="codeString">"myPW"</span>, <span class="codeIdentifier">true</span>);
    ps.addEventListener(<span class="codeString">"onPlazesResult"</span>, resultListener);
    ps.user.getTrazes(<span class="codeNumber">90</span>);
    ps.api.<span class="codeIdentifier">getVersion</span>();</pre></div>
                </div>
              </div>
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="http://beta.plazes.com/api/plazes/doc">PlazesApi documenation</a></div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="summary hasBottomDivider">
          <h2 class="hasBottomDivider"><span id="Summary">Summary</span></h2>
          <div class="methodList">
            <div class="methodSummaryPart"><span class="title">Constructor</span><ul>
                <li>
                  <a href="#PlazesService">PlazesService</a>
                </li>
              </ul>
            </div>
            <div class="methodSummaryPart"><span class="title">Class properties</span><ul>
                <li>
                  <a href="#ENDPOINT">ENDPOINT</a>
                </li>
              </ul>
            </div>
            <div class="methodSummaryPart"><span class="title">Instance properties</span><ul>
                <li>
                  <a href="#devKey">devKey</a>
                </li>
                <li>
                  <a href="#username">username</a>
                </li>
                <li>
                  <a href="#password">password</a>
                </li>
                <li>
                  <a href="#queueCalls">queueCalls</a>
                </li>
                <li>
                  <a href="#plaze">plaze</a>
                </li>
                <li>
                  <a href="#user">user</a>
                </li>
                <li>
                  <a href="#api">api</a>
                </li>
                <li>
                  <a href="#passwordMD5">passwordMD5</a>
                </li>
              </ul>
            </div>
            <div class="methodSummaryPart"><span class="title">Instance methods</span><ul>
                <li>
                  <a href="#addEventListener">addEventListener</a>
                </li>
                <li>
                  <a href="#removeEventListener">removeEventListener</a>
                </li>
              </ul>
            </div>
            <div class="methodSummaryPart"><span class="title">Event handlers</span><ul>
                <li>
                  <a href="#onPlazesResult">onPlazesResult</a>
                </li>
                <li>
                  <a href="#onPlazesFault">onPlazesFault</a>
                </li>
                <li>
                  <a href="#onPlazesError">onPlazesError</a>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="methodSection">
          <h2 class="hasBottomDivider"><span id="Constructor">Constructor</span></h2>
          <div class="method hasBottomDivider">
            <h3 id="PlazesService">PlazesService</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">function <b>PlazesService</b> (



</div>
                <div><span class="code">dKey:String,
uname:String,
passwd:String,
qCalls:Boolean)</span></div>
              </div>
            </div>
            <div class="description">The PlazesService-class constructor.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">Parameters:</span><div class="item">
                    <div class="floatbox code colorizedCode">dKey  <span class="itemSeparator">:</span></div>
                    <div>(optional) The needed developer key for this application</div>
                  </div>
                  <div class="item">
                    <div class="floatbox code colorizedCode">uname <span class="itemSeparator">:</span></div>
                    <div>(optional) The plazes-login username</div>
                  </div>
                  <div class="item">
                    <div class="floatbox code colorizedCode">passwd<span class="itemSeparator">:</span></div>
                    <div>(optional) The plazes-login clear text password</div>
                  </div>
                  <div class="item">
                    <div class="floatbox code colorizedCode">qCalls<span class="itemSeparator">:</span></div>
                    <div>(optional) The boolean whether to process requests sequentially. Default is <code>false</code>.</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="methodSection">
          <h2 class="hasBottomDivider"><span id="Classproperties">Class properties</span></h2>
          <div class="method hasBottomDivider">
            <h3 id="ENDPOINT">ENDPOINT</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">static <b>ENDPOINT</b>:String
</div>
                <div><span class="access">(read)</span></div>
              </div>
            </div>
            <div class="description">The URI of the plazes XMLRPC-interface<br /> Implemented as getter function.<br /></div>
          </div>
        </div>
        <div class="methodSection">
          <h2 class="hasBottomDivider"><span id="Instanceproperties">Instance properties</span></h2>
          <div class="method hasBottomDivider">
            <h3 id="api">api</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>api</b>:<a href="com_orthogeneric_webapis_plazes_methods_ApiMethods.html">ApiMethods</a>
</div>
                <div><span class="access">(read)</span></div>
              </div>
            </div>
            <div class="description">The instance-variable to gain access to remote methods related to the "api".<br /> Implemented as getter function.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">Returns:</span><div class="item">The composited ApiMethods-instance </div>
                </div>
              </div>
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_methods_ApiMethods.html">com.orthogeneric.webapis.plazes.methods.ApiMethods</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="devKey">devKey</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>devKey</b>:String
</div>
                <div><span class="access">(read,write)</span></div>
              </div>
            </div>
            <div class="description">The developer key used for your application</div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="password">password</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>password</b>:String
</div>
                <div><span class="access">(read,write)</span></div>
              </div>
            </div>
            <div class="description">The instance-variable holding/storing the password in clear text.<br /> Implemented as getter/setter function.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_PlazesService.html#passwordMD5">passwordMD5</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="passwordMD5">passwordMD5</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>passwordMD5</b>:String
</div>
                <div><span class="access">(read,write)</span></div>
              </div>
            </div>
            <div class="description">The instance-variable holding the MD5-password used for actual log in.<br /> Implemented as getter/setter function.<br /><br /> Note: Setting a MD5-password using this setter function will set password to an empty string.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_PlazesService.html#password">password</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="plaze">plaze</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>plaze</b>:<a href="com_orthogeneric_webapis_plazes_methods_PlazeMethods.html">PlazeMethods</a>
</div>
                <div><span class="access">(read)</span></div>
              </div>
            </div>
            <div class="description">The instance-variable to gain access to remote methods related to a "plaze".<br /> Implemented as getter function.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">Returns:</span><div class="item">The composited PlazeMethods-instance </div>
                </div>
              </div>
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_methods_PlazeMethods.html">com.orthogeneric.webapis.plazes.methods.PlazeMethods</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="queueCalls">queueCalls</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>queueCalls</b>:Boolean
</div>
                <div><span class="access">(read,write)</span></div>
              </div>
            </div>
            <div class="description">The instance-variable depicting whether remote calls shall be invoked sequentially.<br /> "Queueing" means here that the invocation of a remote method will be delayed until all previously instigated calls have received a response (result, fault or error).<br /> Implemented as getter/setter function.<br /></div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="user">user</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>user</b>:<a href="com_orthogeneric_webapis_plazes_methods_UserMethods.html">UserMethods</a>
</div>
                <div><span class="access">(read)</span></div>
              </div>
            </div>
            <div class="description">The instance-variable to gain access to remote methods related to a "user".<br /> Implemented as getter function.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">Returns:</span><div class="item">The composited UserMethods-instance </div>
                </div>
              </div>
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_methods_UserMethods.html">com.orthogeneric.webapis.plazes.methods.UserMethods</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="username">username</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code"><b>username</b>:String
</div>
                <div><span class="access">(read,write)</span></div>
              </div>
            </div>
            <div class="description">The plazes-login username</div>
          </div>
        </div>
        <div class="methodSection">
          <h2 class="hasBottomDivider"><span id="Instancemethods">Instance methods</span></h2>
          <div class="method hasBottomDivider">
            <h3 id="addEventListener">addEventListener</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">function <b>addEventListener</b> (

</div>
                <div><span class="code">event:String,
listener:Object) : Void</span></div>
              </div>
            </div>
            <div class="description">The instance-method to register an object as a listener to an event dispatched by this PlazesService-instance.<br /> Available events are:<br /> <br />   "onPlazesResult" - dispatched when a result from a remote method has been received<br />   "onPlazesFault" - dispatched when the remote method returned a fault (i.e. failed login)<br />   "onPlazesError" - dispatched when an error (i.e. api is not available) has occurred<br /></div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="removeEventListener">removeEventListener</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">function <b>removeEventListener</b> (

</div>
                <div><span class="code">event:String,
listener:Object) : Void</span></div>
              </div>
            </div>
            <div class="description">The instance-method to un-register an object as a listener to an event dispatched by this PlazesService-instance.</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_PlazesService.html#addEventListener">addEventListener()</a></div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="methodSection">
          <h2 class="hasBottomDivider"><span id="Eventhandlers">Event handlers</span></h2>
          <div class="method hasBottomDivider">
            <h3 id="onPlazesError">onPlazesError</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">function <b>onPlazesError</b> (
</div>
                <div><span class="code">evt:<a href="com_orthogeneric_webapis_plazes_events_PlazesError.html">PlazesError</a>) : Void</span></div>
              </div>
            </div>
            <div class="description">The instance-method that is being invoked when an error occured during a rpc</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_events_PlazesError.html">com.orthogeneric.webapis.plazes.events.PlazesError</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="onPlazesFault">onPlazesFault</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">function <b>onPlazesFault</b> (
</div>
                <div><span class="code">evt:<a href="com_orthogeneric_webapis_plazes_events_PlazesFault.html">PlazesFault</a>) : Void</span></div>
              </div>
            </div>
            <div class="description">The instance-method that is being invoked when a fault has been received as the rpc-response</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_events_PlazesFault.html">com.orthogeneric.webapis.plazes.events.PlazesFault</a></div>
                </div>
              </div>
            </div>
          </div>
          <div class="method hasBottomDivider">
            <h3 id="onPlazesResult">onPlazesResult</h3>
            <div class="fullMemberString">
              <div class="clearfix floatholder">
                <div class="floatbox code">function <b>onPlazesResult</b> (
</div>
                <div><span class="code">evt:<a href="com_orthogeneric_webapis_plazes_events_PlazesResult.html">PlazesResult</a>) : Void</span></div>
              </div>
            </div>
            <div class="description">The instance-method that is being invoked when a result has been received as the rpc-response</div>
            <div class="boxWithBorder">
              <div class="boxedElem">
                <div class="contentHolder"><span class="title">See also:</span><div class="item"><a href="com_orthogeneric_webapis_plazes_events_PlazesResult.html">com.orthogeneric.webapis.plazes.events.PlazesResult</a></div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="footer"><span class="docFooter"><span class="copyright">&copy; 2006 Florian Mlodzik</span><span class="separator">|</span><span class="createdWith">Created with <a href="http://visiblearea.com/visdoc/">VisDoc</a></span><span class="separator">|</span><span class="creationDate">Saturday, 29 July 2006, 01:22:40</span><span class="separator">|</span><a href="#" onclick="showTOC(); return false;" class="showToc">show TOC</a><a href="#" onclick="hideTOC(); return false;" class="hideToc">hide TOC</a></span><span class="tocFooter">&copy; 2006 Florian Mlodzik<span class="separator">|</span><a href="#" onclick="hideTOC(); return false;" class="hideToc">hide TOC</a></span>
        </div>
      </div>
    </div>
  </body>
</html>
